home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_hylafax.idb / usr / freeware / man / cat4 / dialrules.Z / dialrules
Text File  |  2000-06-09  |  11KB  |  257 lines

  1.  
  2.  
  3.  
  4. DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 8888,,,, 1111999999996666))))      DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      dialrules - _H_y_l_a_F_A_X dial string processing rules
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      A dial string specifies how to dial the telephone in order
  13.      to reach a destination facsimile machine, or similar device.
  14.      This string is supplied by a user with each outgoing
  15.      facsimile job.  User-supplied dial strings need to be
  16.      processed in two ways by the _H_y_l_a_F_A_X server processes:  to
  17.      craft a canonical phone number for use in locating the
  18.      receiver's capabilities, and to process into a form suitable
  19.      for sending to a modem.  In addition client applications may
  20.      need to process a dial string to formulate an external form
  21.      that does not include private information such as a credit
  22.      card access code.  Phone number canonicalization and dial
  23.      string preparation are done according to _d_i_a_l _s_t_r_i_n_g
  24.      _p_r_o_c_e_s_s_i_n_g _r_u_l_e_s that are located in a file specified in the
  25.      server configuration file; see the DDDDiiiiaaaallllSSSSttttrrrriiiinnnnggggRRRRuuuulllleeeessss parameter
  26.      in _c_o_n_f_i_g(4F).  The generation of an externalized form for a
  27.      dial string is done by rules that optionally appear in
  28.      /_u_s_r/_f_r_e_e_w_a_r_e/_l_i_b/_f_a_x/_d_i_a_l_r_u_l_e_s on client machines.
  29.  
  30.      A dial string rules file is an ASCII file containing one or
  31.      more _r_u_l_e _s_e_t_s.  A rule set defines a set of _t_r_a_n_s_f_o_r_m_a_t_i_o_n
  32.      _r_u_l_e_s that are sequentially applied to a dial string.  Each
  33.      rule set is associated with an identifier, with certain
  34.      well-known identifiers being used by the facsimile server or
  35.      client application.  Each transformation rule is a regular
  36.      expression and a replacement string; the regular expression
  37.      is repeatedly applied to a dial string and any matching
  38.      substring is replaced by the replacement string.
  39.  
  40.      The syntax of a dial string rules file is as follows.
  41.      Comments are introduced with the ``!'' character and
  42.      continue to the end of the current line.  Identifiers are
  43.      formed from a leading alphabetic and any number of
  44.      subsequent alpha-numeric characters.  A rule set is of the
  45.      form:
  46.           _I_d_e_n_t_i_f_i_e_r ::::==== [[[[
  47.               _r_u_l_e_1
  48.               _r_u_l_e_2
  49.               ...
  50.           ]]]]
  51.      where _r_u_l_e_1, _r_u_l_e_2, and so on are transformation rules.
  52.      Line breaks are significant.  The initial rule set
  53.      definition line and the trailing ``]'' must be on separate
  54.      lines; and each transformation rule must also be on a single
  55.      line.  Transformation rules are of the form:
  56.           _r_e_g_u_l_a_r-_e_x_p_r_e_s_s_i_o_n ==== _r_e_p_l_a_c_e_m_e_n_t
  57.      where _r_e_g_u_l_a_r-_e_x_p_r_e_s_s_i_o_n is a POSIX 1003.2 extended regular
  58.  
  59.  
  60.  
  61. Page 1                                          (printed 3/21/00)
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 8888,,,, 1111999999996666))))      DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))
  69.  
  70.  
  71.  
  72.      expression and _r_e_p_l_a_c_e_m_e_n_t is a string that is substituted
  73.      in place of any portion of the dial string that is matched
  74.      by the _r_e_g_u_l_a_r-_e_x_p_r_e_s_s_i_o_n.  White space is significant in
  75.      parsing transformation rules.  If a regular expression or
  76.      replacement string has embedded white space in it, then the
  77.      white space needs to be escaped with a ``\'' character or
  78.      the entire string should be enclosed in quote (``"'') marks.
  79.      Replacement strings may reference the entire string matched
  80.      by the regular expression with the ``&'' character.
  81.      Substrings matched with the ``(...)'' constructs may be
  82.      referenced by using ``\_n'' where _n is a single numeric digit
  83.      between 1 and 9 that refers to the _n-th matched substring;
  84.      c.f.  _r_e__f_o_r_m_a_t(7), _s_e_d(1), etc.
  85.  
  86.      To simplify and parameterize the construction of rule sets,
  87.      dial string rules files may also include simple text-
  88.      oriented variable definitions.  A line of the form:
  89.           _f_o_o====_s_t_r_i_n_g
  90.      defines a variable named _f_o_o that has the value _s_t_r_i_n_g.
  91.      String values with embedded whitespace must use the ``\''
  92.      character or be enclosed in quote marks.  Variables are
  93.      interpolated into transformation rules by referencing them
  94.      as:
  95.           $$$${{{{_v_a_r}}}}
  96.      Note that variable interpolation is done only once, at the
  97.      time a transformation rule is defined.  This means that
  98.      forward references are not supported and that circular
  99.      definitions will not cause loops.  The facsimile server
  100.      automatically defines four variables to have the values
  101.      defined in its configuration file:  AAAArrrreeeeaaaaCCCCooooddddeeee, CCCCoooouuuunnnnttttrrrryyyyCCCCooooddddeeee,
  102.      LLLLoooonnnnggggDDDDiiiissssttttaaaannnncccceeeePPPPrrrreeeeffffiiiixxxx, and IIIInnnntttteeeerrrrnnnnaaaattttiiiioooonnnnaaaallllPPPPrrrreeeeffffiiiixxxx These variables
  103.      are initialized before parsing a dial string rules file;
  104.      thus if they are defined in the rules file then they will
  105.      override any definition by the server.
  106.  
  107.      There are three well known rule set names:  _C_a_n_o_n_i_c_a_l_N_u_m_b_e_r
  108.      to convert a dial string to a canonical format, _D_i_a_l_S_t_r_i_n_g
  109.      to prepare a dial string before using it to dial the
  110.      telephone, and _D_i_s_p_l_a_y_N_u_m_b_e_r to convert a dial string to an
  111.      external ``displayable'' form that does not include the
  112.      private information that might appear in the raw dial
  113.      string.
  114.  
  115. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  116.      This is the default set of rules for transforming a dial
  117.      string into a canonical phone number:
  118.           Area=${AreaCode}                  ! local area code
  119.           Country=${CountryCode}            ! local country code
  120.           IDPrefix=${InternationalPrefix}   ! prefix for placing an international call
  121.           LDPrefix=${LongDistancePrefix}    ! prefix for placing a long distance call
  122.  
  123.  
  124. Page 2                                          (printed 3/21/00)
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 8888,,,, 1111999999996666))))      DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))
  132.  
  133.  
  134.  
  135.           !
  136.           ! Convert a phone number to a canonical format:
  137.           !
  138.           !    +<country><areacode><rest>
  139.           !
  140.           ! by (possibly) stripping off leading dialing prefixes for
  141.           ! long distance and/or international dialing.
  142.           !
  143.           CanonicalNumber := [
  144.           #.*               =                          ! strip calling card stuff
  145.           [abcABC]          = 2                        ! these convert alpha to numbers
  146.           [defDEF]          = 3
  147.           [ghiGHI]          = 4
  148.           [jklJKL]          = 5
  149.           [mnoMNO]          = 6
  150.           [prsPRS]          = 7
  151.           [tuvTUV]          = 8
  152.           [wxyWXY]          = 9
  153.           [^+0-9]+          =                          ! strip white space etc.
  154.           ^${IDPrefix}      = +                        ! replace int. dialing code
  155.           ^${LDPrefix}      = +${Country}              ! replace l.d. dialing code
  156.           ^[^+]             = +${Country}${Area}&      ! otherwise, insert canon form
  157.           ]
  158.      The first rule simply strips anything following a ``#'';
  159.      this will remove any calling card-related information.  The
  160.      next eight rules convert upper and lower case alphabetics to
  161.      the equivalent key numbers (this is convenient for users
  162.      that use mnemonic phone numbers).  The tenth rule removes
  163.      everything but numbers and plus signs.  The eleventh rule
  164.      translates any explicit international dialing prefix into
  165.      the ``+'' symbol used to identify country codes.  The
  166.      twelfth rule replaces a leading long distance dialing prefix
  167.      with the local country code string.  The last rule matches
  168.      local phone numbers and inserts the local country code and
  169.      area code.
  170.  
  171.      As an example, assume that
  172.           AreaCode=415
  173.           CountryCode=1
  174.           InternationalPrefix=011
  175.           LongDistancePrefix=1
  176.      then if the above set of rules is applied to ``01123965-
  177.      Tube#2345'', the transformations would be:
  178.           01123965-Tube#2345    01123965-Tube    ! strip calling card stuff
  179.           01123965-Tube         01123965-8823    ! convert alphabetics
  180.           01123965-8823         011239658823     ! strip white space etc.
  181.           011239658823          +239658823       ! replace int. dialing code
  182.           +239658823            +239658823       ! replace l.d. dialing code
  183.           +239658823            +239658823       ! otherwise, insert canon form
  184.      for a final result of ``+239658823''.
  185.  
  186.  
  187. Page 3                                          (printed 3/21/00)
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194. DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 8888,,,, 1111999999996666))))      DDDDIIIIAAAALLLLRRRRUUUULLLLEEEESSSS((((4444FFFF))))
  195.  
  196.  
  197.  
  198. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  199.      _s_e_n_d_f_a_x(1), _d_i_a_l_t_e_s_t(1M), _f_a_x_q(1M), _f_a_x_s_e_n_d(1M),
  200.      _f_a_x_g_e_t_t_y(1M), _c_o_n_f_i_g(4F)
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253. Page 4                                          (printed 3/21/00)
  254.  
  255.  
  256.  
  257.